﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProjectCloth.FrmUI.Common
{
    public class LoginInfo
    {
        /// <summary>
        /// 此静态类用于存储用户名
        /// </summary>

        private static LoginInfo FLoginInfo = null;
        public int UserId = 0;
        public string UserName = "";
        public int dbServer = 1;
        public string Connetion = "";
        public string RoleStr = "";
        public LoginInfo()
        {
        }

        public static LoginInfo GetLoginInfo()
        {
            return GetLoginInfo(0, "");
        }

        public static LoginInfo GetLoginInfo(int userID, string userName)
        {
            if (FLoginInfo == null || (userID > 0 && !string.IsNullOrEmpty(userName)))
            {
                FLoginInfo = new LoginInfo();
                FLoginInfo.UserId = userID;
                FLoginInfo.UserName = userName;
                //FLoginInfo.RoleStr
            }
            return FLoginInfo;
        }

    }
}
